fix(nix): use nixpkgs pgbackrest instead of a from-source build#2267
Draft
hunleyd wants to merge 3 commits into
Draft
fix(nix): use nixpkgs pgbackrest instead of a from-source build#2267hunleyd wants to merge 3 commits into
hunleyd wants to merge 3 commits into
Conversation
nix/packages/default.nix's pg-backrest output was a raw passthrough to nixpkgs.legacyPackages.pgbackrest, so the AMI and multigres Docker images got whatever version nixpkgs-unstable happened to have pinned, with no control over optional build features. Add nix/packages/pgbackrest.nix, a from-scratch meson/ninja build pinned to pgBackRest 2.58.0 (latest stable), mirroring the wal-g.nix pattern of an explicit, version-pinned source build. libzstd is forced enabled (not left on meson's "auto" detection) and libssh2/SFTP is disabled since only S3 is needed for now; S3/GCS/Azure support itself isn't meson-gated so nothing else changes there. Registers the new derivation in nix/packages/default.nix and adds it to the enumerated build-check list in nix/checks.nix (mirroring wal-g-2) so CI verifies it builds. No changes needed in ansible/tasks/setup-pgbackrest.yml or Dockerfile-multigres: both consume the pg-backrest flake output by name and continue to get a pgbackrest binary in $out/bin.
PostgreSQL Extension Dependency Analysis: PR #2267
SummaryNo extensions had dependencies with MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Extension DependenciesPostgreSQL 17 Extension DependenciesOrioleDB 17 Extension Dependencies |
PostgreSQL Package Dependency Analysis: PR #2267
SummaryNo packages had MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Dependency ChangesExtracting PostgreSQL 15 dependencies...
Runtime Closure Size
Raw Dependency ClosurePostgreSQL 17 Dependency ChangesExtracting PostgreSQL 17 dependencies...
Runtime Closure Size
Raw Dependency Closure |
brainrake
requested changes
Jul 13, 2026
Contributor
There was a problem hiding this comment.
https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/pg/pgbackrest/package.nix
- Latest pgbackrest 2.58.0 is in nixpkgs. Use this please.
- If not good and need eg. different build options, lease override nixpkgs package instead of copying it verbatim, unless there is a blocker. Lower maintenance burden.
- Add pgbackrest src repo as a non-flake input to the flake. This way hashes are managed using default tools in the lockfile instead of manually.
Contributor
|
If we need to update nixpkgs, lets prioritize that, it needs to be done in any case. Doing the chores is preferable to deep special casing. Special casing will only make it more difficult to stay up to date, which we need to do anyway to bring in stack wide security updates. |
nixpkgs already tracks pgbackrest releases directly and carries 2.58.0 on current nixos-unstable, so the from-scratch meson build added in this PR duplicated a recipe nixpkgs already maintains. Per review feedback, drop nix/packages/pgbackrest.nix and go back to the legacyPackages passthrough for pg-backrest, and bump the nixpkgs flake input so that passthrough resolves to 2.58.0 now rather than waiting for the monthly update-flake-lock automation.
… add The monthly update-flake-lock.yml automation hit the same nixpkgs-jump breakage independently (confirmed by Marton in Slack), so it's being tracked and fixed there instead of bundled into this PR. Reverting flake.lock to develop's current nixpkgs pin unblocks nix-eval CI here; pg-backrest still resolves via the plain nixpkgs.legacyPackages passthrough and will pick up 2.58.0 whenever that separate nixpkgs bump lands.
auto-merge was automatically disabled
July 13, 2026 17:05
Pull request was converted to draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pg-backrest(nix/packages/default.nix) goes back to a plain passthrough ofnixpkgs.legacyPackages.<system>.pgbackrest— nixpkgs already tracks pgbackrest releases directly, so there's no need to duplicate its build recipe here (see review discussion below).nix/packages/pgbackrest.nix, the from-source meson build this PR originally added.nix/checks.nixkeeps thepg-backrestentry added by this PR in the build-check list — verifies the nixpkgs-sourced package builds in CI.pgbackrestas-is.flake.lockchanges here: a manualnixpkgsbump was tried to pick up pgbackrest 2.58.0 immediately, but it brokenix-evalCI (the same breakage independently hit the repo's monthlyupdate-flake-lock.ymlautomation). That nixpkgs bump is being tracked and fixed separately;pg-backrestwill pick up 2.58.0 automatically whenever it lands.ansible/tasks/setup-pgbackrest.ymlinstalls vianix profile install github:supabase/postgres/{{ git_commit_sha }}#pg-backrest, locked to the exact postgres repo commit.No changes needed in
ansible/tasks/setup-pgbackrest.ymlorDockerfile-multigres— both consume thepg-backrestflake output by name and continue to get apgbackrestbinary in$out/bin.Resolves INDATA-520.
Test plan
nix build .#pg-backrestsucceedsnix build .#checks.<system>.pg-backrestsucceeds